<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Selector</title>
  <style>
    *{
      margin: 0;
      padding: 0;
      list-style: none;
    }
    .selector{
      position: relative;
      width: 700px;
      height: 800px;
      margin: 100px auto;
      border: 1px solid #876234;
      font-size: 12px;
    }
    .selector>.selector-adjoin{
      width: 600px;
      height: 50px;
      border: 1px solid #876234;
    }
    .selector>.selector-adjoin>div,p{
      width: 100px;
      height: calc(100% - 2px);
      border: 1px solid #333333;
      float: left;
    }
    .selector>.selector-adjoin>div+p{
      background-color: burlywood;
    }

    .selector-attr>img{
      width: 100px;
      height: 50px;
    }
    .selector-attr>img[alt]{
      border: 10px dashed palegreen;
    }
  </style>
</head>
<body>
  <div class="selector">
    <div class="selector-adjoin">
      <p>获取</p>
      <div>相邻</div>
      <p>+元素adjoin只能选取当前元素之后的第一个相邻dom</p>
      <p>~元素能选取当前元素之后的同级合规dom</p>
    </div>
    <div class="selector-attr">
      <img src="../../img/1.jpg" alt=""><img src="../../img/1.jpg">
    </div>
    <div class="selector-"></div>
    <div class="selector-"></div>
    <div class="selector-"></div>
    <div class="selector-"></div>
  </div>
</body>
</html>